package com.haircut.sys.controller.monitor;

import cn.hutool.core.date.DateUtil;
import com.haircut.sys.vo.server.Server;
import com.modular.result.RspMessage;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.TimeZone;

/**
 * 服务器监控
 * 
 * @author ruoyi
 */
@RestController
@RequestMapping("/b/monitor/server")
public class ServerController
{
    @PreAuthorize("@ss.hasPermi('monitor:server:list')")
    @GetMapping()
    public RspMessage<Server> getInfo() throws Exception
    {
        Server server = new Server();
        server.copyTo();
        server.setJsonDate(DateUtil.date());
        server.setCurrDate(DateUtil.formatDateTime(DateUtil.date()));
        server.setTimeZone(TimeZone.getDefault().getDisplayName());
        return RspMessage.success(server);
    }
}
